<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Vue 模板</title>
  <script src="https://cdn.bootcss.com/vue/2.6.11/vue.min.js"></script>
  <style>
    .box {
      border: 1px solid red;
      margin-bottom: 50px;
      padding-bottom: 20px;
      padding-left: 10px;
    }
    .tip {
      color: red;
    }
  </style>
</head>
<body>
  <!-- 主控区域 -->
  <div id="app">
    <div class="box">
      <h3>v-model</h3>
      <p>
        <input type="text" v-model="msg">
        <br>
        <span class="tip">msg:{{msg}}</span>
      </p>
    </div>

    <div class="box">
      <h3>单选框</h3>
      <p>
        <input type="checkbox" id="checkbox" v-model="checked">
        <label for="checkbox">选中状态：{{ checked }}</label>
      </p>
    </div>

    <div class="box">
      <h3>lazy修饰符</h3>
      <p>
        <input type="text" v-model.lazy="lazyInput">
        <br>
        <span class="tip">lazyInput:{{lazyInput}}</span>
      </p>
    </div>

    <div class="box">
      <h3>trim 修饰符</h3>
      <p> 
        <input type="text" v-model.trim="trimInput">
        <br>
        trimInput: {{trimInput.length}}
      </p>
    </div>

  </div>
  
  <script>
    var vue = new Vue({
      el: "#app",
      data: {
        msg: "",
        checked: '',
        lazyInput: '',
        trimInput: ''
      }
    })
  </script>
</body>
</html>